<!DOCTYPE html>
<title>Character Decoding - Truncated Sequences</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="resources/char-decoding-utils.js"></script>
<script>

// UTF-8 codec emits replacement characters
testDecode('utf-8', '%E2%88%9A', 'U+221A');
testDecode('utf-8', '%E2%88', 'U+FFFD');
testDecode('utf-8', '%E2', 'U+FFFD');

// UTF-16 codec does not emit replacement characters
testDecode('utf-16', '%69%D8%D6%DE', 'U+D869/U+DED6');
testDecode('utf-16', '%69%D8%D6', '');
testDecode('utf-16', '%69%D8', '');
testDecode('utf-16', '%69', '');
testDecode('utf-16be', '%D8%69%DE%D6', 'U+D869/U+DED6');
testDecode('utf-16be', '%D8%69%DE', '');
testDecode('utf-16be', '%D8%69', '');
testDecode('utf-16be', '%D8', '');

// Other codecs emit replacement characters
testDecode('gb2312', '%A3%A0', 'U+3000');
testDecode('gb2312', '%A3', 'U+FFFD');
testDecode('shift_jis', '%82%d0', 'U+3072');
testDecode('shift_jis', '%82', 'U+FFFD');
testDecode('windows-949', '%A2%E6', 'U+20AC');
testDecode('windows-949', '%A2', 'U+FFFD');

</script>
